package com.ysd.lis.controller.self;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.dto.slef.FunctionParam;
import com.ysd.lis.entity.lab.LabRptVsBarcode;
import com.ysd.lis.entity.slef.SelfMachineFunction;
import com.ysd.lis.request.DeleteRptVsBarCodeParam;
import com.ysd.lis.service.self.SelfMachineFunctionService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wh
 * @since 2025-05-13
 */
@RestController
@RequestMapping("/self/machineFunction")
public class SelfMachineFunctionController extends BaseController {

    @Autowired
    private SelfMachineFunctionService labRptVsBarcodeService;

    @ApiOperation("添加对照关系")
    @PostMapping("/addMachineFunction")
    public Result addMachineFunction(@RequestBody SelfMachineFunction selfMachineFunction) {
        return labRptVsBarcodeService.addMachineFunction(selfMachineFunction);
    }

    @ApiOperation("获取右侧数据")
    @GetMapping("/findFunction")
    public Result findFunction( FunctionParam functionParam) {
        return labRptVsBarcodeService.findFunction(functionParam);
    }

    @ApiOperation("获取中间数据")
    @GetMapping("/findMachineFunction/{suid}")
    public Result findMachineFunction(@PathVariable("suid") String suid) {
        return labRptVsBarcodeService.findMachineFunction(suid);
    }

    @ApiOperation("删除对照关系")
    @PostMapping("/deleteMachineFunction")
    public Result deleteMachineFunction(@RequestBody SelfMachineFunction selfMachineFunction){
        return labRptVsBarcodeService.deleteMachineFunction(selfMachineFunction);
    }
}
